<!DOCTYPE html>
<html>
<head>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<style>
    body {
        direction: rtl;
        margin: 0px;
    }

    #layer {
        position: absolute;
        top: 50px;
        right: 50px;
        width: 100px;
        height: 100px;
        background-color: red;
    }

    #root {
        width: 1000px;
        height: 1000px;
        will-change:transform;
    }
</style>
<script>
    function doTest() {
        runAfterLayoutAndPaint(function() {
            // This test passes if this element is repainted correctly, even
            // on a page that is composited and has horizontal overflow.
            var elem = document.getElementById("layer");
            elem.style.backgroundColor = "green";
        }, true);
    }
    window.addEventListener('load', doTest, false);
</script>
<body>
    <div id="layer" class=""></div>
    <div id="root"></div>
</body>
</html>
